<script setup lang="ts">
import { NButton, NIcon, NTooltip } from 'naive-ui'
import { Copy, Repeat } from '@vicons/tabler'
import BaseMessage from './BaseMessage.vue'
import type { Message } from './type'

const props = defineProps<{
  message: Message
}>()

const emit = defineEmits<{
  (e: 'copy'): void
}>()

const copyMessage = () => {
  emit('copy')
}
</script>

<template>
  <BaseMessage :message="message" placement="left" type="text" :editable="false">
    <template #header>机器人</template>
    <template #actions>
      <NTooltip trigger="hover" size="small" :show-arrow="false" raw :duration="10">
        <template #trigger>
          <NButton size="tiny" text @click="copyMessage">
            <template #icon><NIcon :component="Copy" /></template>
          </NButton>
        </template>
        <span class="text-black text-xs items-end flex p-2 rounded-xl bg-gray-100">复制</span>
      </NTooltip>
    </template>
  </BaseMessage>
</template>
